<!doctype html>
<html class="no-js fixed-layout">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{$title}</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="__PUBLIC__/static/admin/i/favicon.ico">
  <link rel="stylesheet" href="__PUBLIC__/static/admin/css/amazeui.min.css"/>
  <link rel="stylesheet" href="__PUBLIC__/static/admin/css/admin.css">
  <block name="css"></block>
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->
<!-- am-topbar-inverse -->
<header class="am-topbar am-topbar-inverse admin-header">
  <div class="am-topbar-brand top-bar-brand" style="overflow: hidden;">
    <a href="/" target="_blank"><strong>{:F('webSet')['webtitle']}</strong></a> <a href="{:U('index/index')}"><small>后台管理</small></a> 
  </div>
    <div class="am-fl am-hide-sm-only am-icon-list switchm" onclick="javascript:$('#admin-offcanvas').toggle('normal');"></div>

  <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

  <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

    <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
      <li class="am-dropdown" data-am-dropdown>
        <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
          <span class="am-icon-user"></span> 管理员 <span class="am-icon-caret-down"></span>
        </a>
        <ul class="am-dropdown-content">
          <li><a href="{:U('user/userinfo')}"><span class="am-icon-user"></span> 资料</a></li>
          <li><a href="{:U('user/logout')}"><span class="am-icon-power-off"></span> 退出</a></li>
        </ul>
      </li>
      <li class="am-hide-sm-only"><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> <span class="admin-fullText">开启全屏</span></a></li>
    </ul>
  </div>
</header>

<div class="am-cf admin-main">
  <!-- sidebar start -->
  <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
    <div class="am-offcanvas-bar admin-offcanvas-bar">
      <div class="am-panel am-panel-default admin-sidebar-panel">
              <div class="am-panel-bd">
                <img src="<?php echo session('userinfo')[0]['avatar']==''?'__PUBLIC__/static/admin/i/avatar.jpg':session('userinfo')[0]['avatar'];?>" id="adminimg" alt="头像" width="70%">
                <div style="text-align:center;">
                  <span style="font-size:20px;font-weight:bold"><?php echo session('userinfo')[0]['username'];?></span>
                  <button class="am-btn am-btn-primary"
                          data-am-popover="{theme: 'primary',content: '上次登录IP：<br><span>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo session('userinfo')[0]['login_ip'];?></span><br>上次登录时间：<br><span>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo date('Y-m-d H:i:s',session('userinfo')[0]['last_login_time']);?></span>', trigger: 'hover focus'}">
                    更多登录信息
                  </button>
                </div>
              </div>
            </div>
      <ul class="am-list admin-sidebar-list">
        <li><a <if condition='strtolower("__ACTION__") eq "/babage/index/index"'>class="activem"</if> href="{:U('index/index')}"><span class="am-icon-home"></span> 首页</a></li>
        <li class="admin-parent">
          <a class="am-cf" data-am-collapse="{target: '#collapse-nav'}"><span class="am-icon-file"></span> 文章管理 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
          <ul class="am-list am-collapse admin-sidebar-sub <if condition='$am_in eq 1'>am-in</if>" id="collapse-nav">
            <li><a <if condition='strtolower("__ACTION__") eq "/babage/categories/index"'>class="activem"</if> href="{:U('categories/index')}"><span class="am-icon-th-large"></span> 文章分类</a></li>
            <li><a <if condition='strtolower("__ACTION__") eq "/babage/articles/add"'>class="activem"</if> href="{:U('articles/add')}"><span class="am-icon-plus-square"></span> 添加文章</a></li>
            <li><a <if condition='strtolower("__ACTION__") eq "/babage/articles/alist"'>class="activem"</if> href="{:U('articles/alist')}"><span class="am-icon-list"></span> 文章列表</a></li>
            <li><a <if condition='strtolower("__ACTION__") eq "/babage/articles/recycle"'>class="activem"</if> href="{:U('articles/recycle')}"><span class="am-icon-trash-o"></span> 文章回收站</a></li>  
          </ul>
        </li>
        
        <li><a <if condition='strtolower("__ACTION__") eq "/babage/links/index"'>class="activem"</if> href="{:U('links/index')}"><span class="am-icon-link"></span> 友情链接</a></li>
        <li><a <if condition='strtolower("__ACTION__") eq "/babage/messages/index"'>class="activem"</if> href="{:U('messages/index')}"><span class="am-icon-comments"></span> 站点留言</a></li>
        <li><a <if condition='strtolower("__ACTION__") eq "/babage/index/menu"'>class="activem"</if> href="{:U('index/menu')}"><span class="am-icon-bars"></span> 菜单管理</a></li>
        <li><a <if condition='strtolower("__ACTION__") eq "/babage/index/webset"'>class="activem"</if> href="{:U('index/webset')}"><span class="am-icon-cog"></span> 站点设置</a></li>
        <li class="admin-parent">
          <a class="am-cf" data-am-collapse="{target: '#collapse-nav2'}"><span class="am-icon-database"></span> 数据库与缓存 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
          <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav2">
            <li onclick="dbbake()"><a href="javascript:void(0);"><span class="am-icon-database"></span> 备份数据库</a></li>
            <li onclick="deleteCache()"><a href="javascript:void(0);"><span class="am-icon-soundcloud"></span> 清除缓存</a></li>
          </ul>
        </li>

        <li><a <if condition='strtolower("__ACTION__") eq "/babage/index/logs"'>class="activem"</if> href="{:U('index/logs')}"><span class="am-icon-file-text"></span> 系统日志</a></li>
        <li><a href="{:U('user/logout')}"><span class="am-icon-sign-out"></span> 退出</a></li>
      </ul>

      <div class="am-panel am-panel-default admin-sidebar-panel">
        <div class="am-panel-bd">
          <p><span class="am-icon-bookmark"></span> Tip</p>
          <p>青春啊，永远是美好的，可是真正的青春，只属于这些永远力争上游的人，永远忘我劳动的人，永远谦虚的人！—— 雷锋</p>
        </div>
      </div>
    </div>
  </div>
  <!-- sidebar end -->

  <!-- content start -->
  <div class="admin-content">
  
    <block name='admin-content-body'></block>

    <footer class="admin-content-footer">
      <hr>
      <p class="am-padding-left">Powered By <a href="http://www.mengfan.club:9000" target="_blank">mengfan</a> |  {:F('webSet')['webtitle']}</p>
    </footer>
  </div>
  <!-- content end -->

</div>

<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="__PUBLIC__/static/admin/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="__PUBLIC__/static/admin/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="__PUBLIC__/static/admin/js/amazeui.min.js"></script>
<script src="__PUBLIC__/static/admin/js/admin.js"></script>
<script src="__PUBLIC__/static/layer/layer.js"></script>
<block name="js"></block>
<script type="text/javascript">
  function dbbake(){
    layer.prompt({title: '输入数据库密码', formType: 1}, function(pass, index){
      layer.close(index);
      $.post('{:U("admin/index/dbbake")}',{'password':pass},function(res){
        if(res.status){
          layer.msg(res.msg);
        }else{
          layer.alert(res.msg);
        }
      });
    });
  }
  function deleteCache(){
    layer.confirm('确定要清除缓存数据吗？', {
        btn: ['确定','取消']
      },function(){
        $.post('{:U("admin/index/deleteCache")}',{},function(res){
          if(res.status){
            layer.msg(res.msg);
          }else{
            layer.alert(res.msg);
          }
        });
    },function(){});
  }
</script>
</body>
</html>